package com.clqteam.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.clqteam.dao.InsertEmployeeDao;
import com.clqteam.util.JDBCutil;


public class InsertEmployeeDaoImpl implements InsertEmployeeDao{

	@Override
	public boolean insertEmployeeInfo(String eAccount, String ePsw, String eName, int rId) {
		boolean b=false;
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT into s_employee");
		sql.append(" (s_employee.eAccount,s_employee.ePsw,s_employee.eName,s_employee.rId)");
		sql.append(" VALUES(?,?,?,?)");
		Connection con=JDBCutil.getConnection();
		try {
			PreparedStatement pst=con.prepareStatement(sql.toString());
			pst.setString(1,eAccount);
			pst.setString(2,ePsw);
			pst.setString(3, eName);
			pst.setInt(4,rId);
			int i=pst.executeUpdate();
			if(i>0){
				b=true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return b;
		
	}



}
